<!DOCTYPE html>
<html lang="en">
<head>
    <title>客户详细信息</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <script src="https://file.ggxqce.com/web/vue.min.js"></script>
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <style>
        [v-cloak] {
            display: none;
        }

        * {
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            font-size: 12px;
        }

        body {
            margin: 0px;
            background: #f8f8f8;
        }

        table {
            border-spacing: 0;
            border-collapse: collapse;
            display: table;
        }

        th {
            font-weight: bold;
        }

        table.text-center, table.text-center td, table.text-center th {
            text-align: center;
            font-size: 12px;
        }

        .table-bordered > thead > tr > th, .table-bordered > tbody > tr > th, .table-bordered > tfoot > tr > th, .table-bordered > thead > tr > td, .table-bordered > tbody > tr > td, .table-bordered > tfoot > tr > td {
            border: 1px solid #cbcbcd;
            height: 29px;
            position: relative;
            color: #333;
            padding: 0 4px;
        }

        .table th {
            background: yellow;
        }

        .table-bordered {
            border: 1px solid #cbcbcd;
        }

        .table {
            width: 100%;
            max-width: 100%;
        }

        .hidden {
            display: none;
        }

        .lineOne, .lineTwo, .lineF {
            text-align: left;
        }

        .tdColor {
            background-color: #f5f5f5;
            /*font-weight: bold;*/
        }
        td span {
            color: #2a8cec;
            padding: 0 6px;
        }

        .lineOne span {
            max-height: 29px;
            line-height: 29px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .lineTwo span {
            max-height: 48px;
            line-height: 14px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 3;
            text-align: left;

        }

        .lineF span {
            max-height: 140px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 7;
            text-align: left;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .tdColor {
            width: 25%;
            background: #f5f5f5;
        }

        .td-value {
            text-align: left !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }

        .td-value span {
            display: inline-block;
            max-height: 56px;
            overflow: hidden;
            padding: 0 6px;
            word-wrap: break-word;
            text-align: center !important;
        }

        .td-value1 {
            text-align: center !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }

        .st {
            width: 25%;
        }

        .boxItem {
            width: 100%;
            background: inherit;
            background-color: rgba(255, 255, 255, 1);
            border: none;
        }

        .jiaobiao {
            position: relative;
        }

        .jiaobiao i {
            display: block;
            width: 0;
            height: 0;
            border-width: 0px 0 12px 12px;
            border-style: solid;
            border-color: transparent transparent transparent #2a8cec;
            position: absolute;
            top: 0px;
            left: 0px;
        }
    </style>
</head>
<body>
<section class="content" id="app" v-cloak>
    <div class="div-td-content-more"><i></i></div>
    <div class="boxItem">
        <div class="boxBoy">
            <table class="table table-bordered text-center table-width">
                <tbody>
                <template>
                    <tr>
                        <td colspan="4" class="tdColor">基本信息</td>
                    </tr>
                    <tr>
                        <td class="tdColor" style="width: 25%;">客户姓名</td>
                        <td style="width: 25%;">
                        <span>
                            {{customer.name}}
                        </span>
                        </td>
                        <td class="tdColor" style="width: 25%;">客户电话</td>
                        <td style="width: 25%;"><span>{{customer.tel?customer.tel:"-"}}</span></td>
                    </tr>
                    <!-- <tr>
                         <td class="tdColor">客户所在地</td>
                         <td><span>{{customer.cityName}}-{{customer.countyName}}</span></td>
                         <td class="tdColor">购买时间</td>
                         <td><span>{{customer.buyDate}}</span></td>
                     </tr>-->
                    <tr>
                        <td class="tdColor">客户类型</td>
                        <td><span>{{customer.customerType?customer.customerType:"-"}}</span></td>
                        <td class="tdColor">客户信用</td>
                        <td><span>{{customer.customerCredit?customer.customerCredit:"-"}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdColor">客户生日</td>
                        <td><span>{{customer.birthday?customer.birthday:"-"}}</span></td>
                        <td class="tdColor">客户微信</td>
                        <td><span>{{customer.wechat?customer.wechat:"-"}}</span></td>
                    </tr>
                    <tr>
                        <td class="tdColor">客户身份证</td>
                        <td><span>{{customer.idCard?customer.idCard:"-"}}</span></td>
                        <td class="tdColor">客户所在地</td>
                        <td><span>{{customer.provinceName?customer.provinceName:"-"}}</span></td>
                    </tr>
                    <tr>
                        <td class="tdColor">客户来源</td>
                        <td><span>{{customer.source?customer.source:"-"}}</span></td>
                        <td class="tdColor">意向机型</td>
                        <td><span>{{customer.intentionModel?customer.intentionModel:"-"}}</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdColor">购买方式</td>
                        <td><span>{{customer.buyType?customer.buyType:"-"}}</span></td>
                        <td class="tdColor">购买时间</td>
                        <td><span>{{customer.buyDate?customer.buyDate:"-"}}</span></td>
                    </tr>
                    <!--<tr v-for="(item,i) in customerVisit">
                        <template v-if="i<3">
                            <td class="tdColor jiaobiao">{{item.createTime}}</td>
                            <td colspan="3" class="lineF"><span>{{item.otherCondition}}</span></td>
                        </template>

                    </tr>-->
                    <!--<tr>
                        <td  class="tdColor">基本情况</td>
                        <td  colspan="3" class="lineF"><span>{{customer.OtherCondition}}</span></td>
                    </tr>-->
                </template>
                <!--跟踪记录-->
                <tr>
                    <td colspan="4" class="tdColor">跟踪记录</td>
                </tr>
                <template v-if="customerVisit.length>0">
                    <template v-for="(item,i) in customerVisit">
                        <tr>
                            <td class="tdColor jiaobiao" style="width: 25%;"><i></i>拜访时间</td>
                            <td><span>{{item.createTime}}</span></td>
                            <td class="tdColor">拜访方式</td>
                            <td>
                                <span v-if="item.visitModel==1">面访</span>
                                <span v-else-if="item.visitModel==0">电访</span>
                                <span v-else></span>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdColor">拜访人员</td>
                            <td colspan="3" style="text-align: left;padding-left: 30px;"><span>{{item.createName}}</span>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdColor">拜访内容</td>
                            <td colspan="3" class="lineF"><span>{{item.otherCondition}}</span></td>
                        </tr>
                    </template>
                </template>
                <template v-else>
                    <tr>
                        <td colspan="5">暂无跟踪数据~</td>
                    </tr>
                </template>

                </tbody>
            </table>
        </div>
        <div class="clear"></div>
    </div>
    <!-- /.box-body -->
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="/dist/plugins/scroll/myScroll.js"></script>
<!--框架已定义 JS-->
<!--oa自定义  JS-->
<script src="/dist/js/oaApp.js"></script>

<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo,.lineF", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + "px",
                        "left": $(this).offset().left,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script>
    $.ajaxSetup({
        global: true,
        type: "POST",
        cache: false,
        dataType: "json",
        contentType: 'application/json;charset=utf-8',
        beforeSend: function () {
        },
        complete: function () {

        },
        error: function (e) {
            alert('error' + e.responseText);
        }
    });
    $.extend($.wyui, {
        postMethod: function (url, data, callback, sync, id) {
            if (!id) {
                id = "#app"
            }
            $.ajax({
                url: server.ip + url,
                async: sync ? false : true,
                data: JSON.stringify(data),
                beforeSend: function () {

                },
                complete: function () {
                    setTimeout(function () {
                    }, 1000);

                },
                success: function (r) {
                    if (!r.e.code) {
                        callback(r.data.sendData);
                    } else {
                        alert(r.e.desc);
                    }
                },
                error: function (e) {
                    alert(url + e.responseText);
                }
            });
        },
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            userId: getUrlParamObj().userId,
            yesterday: new Date(new Date() - 24 * 60 * 60 * 1000).Format("yyyy-MM-dd"),
            today: new Date().Format("yyyy-MM-dd"),//今天
            hour: new Date().getHours(),
            thisMonth: new Date().Format("yyyy-MM"),
            thisWeek: new Date().Format("yyyy-MM-dd") + "-w",
            customer: {
                name: '',
                tel: '',
                wechat: '',
                birthday: '',
                idCard: '',
                provinceName: '',
                cityName: '',
                countyName: '',
                source: '',
                intentionModel: '',
                buyType: '',
                buyDate: '',
                fundCondition: '',
                existingDevice: '',
                OtherCondition: '',
                grade: ''
            },
            customerVisit: []
        },
        methods: {
            formatDate: function (now) {
                var d = new Date(now);
                var hour = d.getHours();
                var minute = d.getMinutes();
                var second = d.getSeconds();
                if (hour < 10) {
                    hour = "0" + hour;
                }
                if (minute < 10) {
                    minute = "0" + minute;
                }
                if (second < 10) {
                    second = "0" + second;
                }
                return hour + ":" + minute + ":" + second;
            },
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
            //合并单元格
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                list[k][field + 'span']++;
                                list[k][field + 'dis'] = false;
                                list[i][field + 'span'] = 1;
                                list[i][field + 'dis'] = true;
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            },
        },
        mounted: function () {
            var that = this;
            var data = {'customerId': getUrlParamObj().customerId, 'userId': that.userId}
            $.wyui.postMethod('/customerReport/getCustomerById.json', data, function (r) {
                that.customer = r.customerInfo;
                var list = []
                for (var i = 0; i < r.customerVisitInfo.length; i++) {
                    if (r.customerVisitInfo[i].otherCondition != "") {
                        list.push(r.customerVisitInfo[i]);
                    }
                }
                console.log(list)
                that.customerVisit = list;
            });

        }
    });

</script>

</body>
</html>